<?php
/**
 * The browse view file of group module of ZenTaoPMS.
 *
 * @copyright   Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Chunsheng Wang <chunsheng@cnezsoft.com>
 * @package     group
 * @version     $Id: browse.html.php 4769 2013-05-05 07:24:21Z wwccss $
 * @link        http://www.zentao.net
 */
?>
<?php include '../../common/view/header.html.php';?>
<style>
    .table a {
        color: #0c60e1;
    }
    .table a.disabled {
        pointer-events: none;
        cursor: not-allowed;
        filter: grayscale(1);
        -webkit-box-shadow: none;
        box-shadow: none;
        opacity: .5;
        -webkit-filter: grayscale(1);
        color: rgba(60,67,83,1);
        background-color: transparent;
        border-color: transparent;
        background: none;
    }
</style>
<div id='mainContent' class='main-row'>
    <div class='main-col'>
    <?php if(empty($approvals)):?>
        <div class="cell">
            <div class="table-empty-tip">
                <p><span class="text-muted"><?php echo $lang->error->noData;?></span></p>
            </div>
        </div>
    <?php else:?>
        <div class='cell'>
            <div class='panel'>
                <div class="panel-heading">
                    <div class="panel-title"><?php echo $title;?></div>
                    <nav class="panel-actions btn-toolbar"><?php common::printLink('approval', "edit","code=", "创建", '', "class='iframe btn btn-primary' data-width='780'",true,true); ?></nav>
                </div>
                <div data-ride='table'>
                    <table class='table table-condensed table-striped table-bordered table-fixed no-margin table-hover' id="workload">
                        <thead>
                            <tr>
                                <th class="w-50px">序号</th>
                                <th class='text-center'><?php echo $lang->approval->code;?></th>
                                <th><?php echo $lang->approval->project;?></th>
                                <th><?php echo $lang->approval->leader;?></th>
                                <th><?php echo $lang->approval->apply;?></th>
                                <th><?php echo $lang->approval->begin;?></th>
                                <th><?php echo $lang->approval->end;?></th>
                                <th><?php echo $lang->approval->leaderGroup;?></th>
                                <th><?php echo $lang->approval->counterpart;?></th>
                                <th><?php echo $lang->approval->budget;?></th>
                                <th><?php echo $lang->approval->number;?></th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php $id = 0;foreach($approvals as $key => $approval):?>
                        <?php $code = $approval['code'];$projectId = $approval['projectId']; $i+=1; ?>
                            <tr>
                                <td><?php echo $i; ?></td>
                                <td class='text-center'>
                                    <?php
                                    echo html::a($this->createLink('approval', 'view', "code=$code"), $approval['code'], '', "class=''");
                                    ?>
                                </td>
                                <td><?php echo html::a($this->createLink('project', 'view', "projectID=$projectId"), $approval['project']); ?></td>
                                <td><?php echo $users[$approval['leader']];?></td>
                                <td><?php echo $approval['apply'];?></td>
                                <td><?php echo $approval['begin'];?></td>
                                <td><?php echo $approval['end'];?></td>
                                <td><?php echo mb_substr(($depts[$approval['leaderGroup']]),1,mb_strlen(($depts[$approval['leaderGroup']])),'utf-8') ;?></td>
                                <td><?php echo $approval['counterpart'];?></td>
                                <td><?php echo ($approval['budget']);?></td>
                                <td><?php echo $approval['number'] . ' 人';?></td>
                                <td>
                                    <?php if(common::hasPriv('approval', 'edit')) common::printLink('approval', "edit","code=$code", "编辑", '', "class='iframe' data-width='900' style='margin-right:10px;'",true,true); ?>
                                    <?php if(common::hasPriv('approval', 'delete')) common::printLink('approval', "delete","code=$code", "删除", '', "class='iframe ' data-width='780' ",true,true); ?>
                                </td>
                            </tr>
                        <?php endforeach;?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    <?php endif;?>
    </div>
</div>
<?php include '../../common/view/footer.html.php';?>
